package com.xiaoshuidi.cloud.module.member.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 意见反馈状态枚举
 */
@Getter
@AllArgsConstructor
public enum FeedbackStatusEnum {

    UNPROCESSED("1", "未处理"),
    PROCESSED("2", "已处理")
    ;

    private String code;
    private String name;

    public static String getNameByCode(String code){
        FeedbackStatusEnum feedbackStatusEnum = Arrays.stream(FeedbackStatusEnum.values()).filter(p -> p.getCode().equals(code)).findFirst().orElse(null);
        if(ObjectUtil.isEmpty(feedbackStatusEnum)){
            return "";
        }
        return feedbackStatusEnum.getName();
    }
}
